<script language="javascript" type="text/javascript" src="../admin/p_evento/valida_form.js"></script>
<?php 
	include "../admin/p_usuario/valida_credenciais.php";
	
	$valCr = new valida_credenciais();
	//$nivel define o array de acessos, ou seja, os grupos que podem acessar essa pagina
	$nivel = array(1);
	if(!($valCr->validar($nivel))){
		header('Location: index.php?pg=denied');
	}
	
	$id = $_GET['i'];
	$resul = mysql_query("SELECT * FROM `eventos` WHERE `eventos`.`id_evento` = $id");
	$evento = mysql_fetch_array($resul);

?>
<div class="form">
	<div class="row">
		<div class="col-md-12">
			<div class="page-header">
				<h2>Editar dados do Evento</h2>
			</div>
		</div>
	</div>
	<div class="row">
	<div class="col-md-3">
		<?php include "../admin/p_evento/actions-evento.php"; ?>
		
		</div><!-- end col md 3 -->
		<div class="col-md-9">
		<!-- HEAD DE FORMULÃ�RIO -->
		<div class="panel panel-default">
			<div class="panel-heading"><h5>Formul&aacuterio para editar informa&ccedil&otildees do Evento</h5></div>
			<div class="panel-body">
			<!-- FORMULÃ�RIO -->
			<form  method="post" name="form1" action="../admin/p_evento/editar.php" enctype="multipart/form-data">
				<div class="row">
					<div class="col-md-12 form-group"><h6>(<span class="text-danger">*</span>) Campos de preenchimento obrigat&oacuterio.</h6></div>
				</div>
				<input type="hidden" name="idevento" value="<?php echo $evento['id_evento'];?>">
				
				<div class="row">
					<div class="form-group col-md-12">
						<label for="evento">Nome do Evento (<span class="text-danger">*</span>)</label>
    					<input type="text" class="form-control" name="evento" id="evento" value="<?php echo $evento['nome_evento'];?>">
					</div>
				</div>
				
				<div class="row">
					<div class="form-group col-md-4">
						<label for="status">Situa&ccedil&atildeo (<span class="text-danger">*</span>)</label>
    					<select name="status" id="status" class="form-control">
		          			<option value='selecione'>Selecione...</option>
		          			<?php if($evento['status'] == 1){ ?>
								<option value="<?php echo $evento['status']; ?>" selected>Evento Ativo</option>
								<option value="0">Evento Inativo</option>
							<?php } else{?>
								<option value="<?php echo $evento['status']; ?>" selected>Evento Inativo</option>
								<option value="1">Evento Ativo</option>
							<?php }?>
		          		</select>
		          	</div>
				</div>
				
				<div class="row">
					<div class="form-group col-md-12">
						<label for="desc_evento">Descri&ccedil&atildeo (<span class="text-danger">*</span>)</label>
    					<textarea rows="5" cols="" class="form-control" id="desc_evento" name="desc_evento"><?php echo $evento['descricao_evento'];?></textarea>
					</div>
				</div>
				
				<br>
				<div class="row">
					<div class="form-group col-md-2">
						<input type="submit" value="Salvar" class="btn btn-default" name="enviar" onclick="return valida()" >
					</div>
				</div>
			</form>
			</div>
		</div>

		</div><!-- end col md 12 -->
	</div><!-- end row -->
</div>
			